package demo.pattern.factory.simple;

import demo.pattern.factory.entity.AppleMouse;
import demo.pattern.factory.entity.DellMouse;
import demo.pattern.factory.entity.Mouse;

public class MouseFactory {
    /**
     * 根据不同的传入参数, 返回不同的Mouse产品类
     * @param brand 品牌
     * @return
     */
    public Mouse createMouse(int brand) {
        switch (brand) {
            case 1: return new DellMouse();
            case 2: return new AppleMouse();
            default: return new DellMouse();
        }
    }
}
